
import Cookies from 'js-cookie'
import { APP_KEY } from '@/config/app'

export const getCookie = (key) => {
  const data = Cookies.get(APP_KEY + key)

  if (data === undefined) return data

  return JSON.parse(data)
}

export const setCookie = (key, data) => {
  data = JSON.stringify(data)
  return Cookies.set(APP_KEY + key, data)
}
